#!/usr/bin/perl
#
#
open(VIBS,$ARGV[0]);
while($line=<VIBS>) {
	chomp($line);
	($vib,$count) = split(/\s+/,$line);
	$vib=~s/^_+//g;
	$vib=~s/_+$//g;
	$vibs{$vib} = $count;
}
close(VIBS);

while($line=<STDIN>) {
	chomp($line);
	$line=~s/\s+/__/g;
	$line="_".$line;
	$line.="_";

	$onlyVib = "";
	foreach $vib (keys %vibs) {
		while($line=~s/_$vib\_//g) {
			$onlyVib.="_".$vib."_";
		}
	}
	$onlyVib=~s/^_+//g; $onlyVib=~s/_+$//g;
	$onlyVib=~s/_+/ /g;

	$line=~s/^_+//g; $line=~s/_+$//g; $line=~s/_+/ /g;
	print $onlyVib."\n";
	print STDERR $line."\n";
}
